Extracted ActionPrivileges interface and created RoleBasedActionPrivileges implementation and SubjectBasedActionPrivileges implementation#5374
Merged
DarshitChanpura merged 12 commits intoopensearch-project:mainfrom Jun 11, 2025
Conversation
nibix
commented
Jun 3, 2025
...nTest/java/org/opensearch/security/privileges/actionlevel/RoleBasedActionPrivilegesTest.java
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5374 +/- ##
==========================================
+ Coverage 72.27% 72.37% +0.10%
==========================================
Files 381 384 +3
Lines 23714 23819 +105
Branches 3655 3669 +14
==========================================
+ Hits 17139 17239 +100
- Misses 4772 4779 +7
+ Partials 1803 1801 -2
🚀 New features to boost your workflow:
|
…leges implementation and SubjectBasedActionPrivileges implementation Signed-off-by: Nils Bandener <nils.bandener@eliatra.com>
…leges implementation and SubjectBasedActionPrivileges implementation Signed-off-by: Nils Bandener <nils.bandener@eliatra.com>
…leges implementation and SubjectBasedActionPrivileges implementation Signed-off-by: Nils Bandener <nils.bandener@eliatra.com>
4464727 to
a7588f6
Compare
cwperks
reviewed
Jun 5, 2025
src/main/java/org/opensearch/security/privileges/PrivilegesEvaluator.java
Show resolved
Hide resolved
cwperks
reviewed
Jun 5, 2025
src/main/java/org/opensearch/security/privileges/PrivilegesEvaluator.java
Show resolved
Hide resolved
cwperks
previously approved these changes
Jun 6, 2025
src/main/java/org/opensearch/security/privileges/actionlevel/RoleBasedActionPrivileges.java
Show resolved
Hide resolved
src/main/java/org/opensearch/security/privileges/actionlevel/RoleBasedActionPrivileges.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/privileges/actionlevel/RoleBasedActionPrivileges.java
Show resolved
Hide resolved
src/main/java/org/opensearch/security/privileges/actionlevel/RoleBasedActionPrivileges.java
Show resolved
Hide resolved
src/main/java/org/opensearch/security/privileges/actionlevel/RoleBasedActionPrivileges.java
Show resolved
Hide resolved
src/main/java/org/opensearch/security/privileges/actionlevel/SubjectBasedActionPrivileges.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/privileges/actionlevel/SubjectBasedActionPrivileges.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/privileges/actionlevel/SubjectBasedActionPrivileges.java
Show resolved
Hide resolved
src/main/java/org/opensearch/security/privileges/actionlevel/SubjectBasedActionPrivileges.java
Show resolved
Hide resolved
...st/java/org/opensearch/security/privileges/actionlevel/SubjectBasedActionPrivilegesTest.java
Show resolved
Hide resolved
Signed-off-by: Nils Bandener <nils.bandener@eliatra.com>
Signed-off-by: Nils Bandener <nils.bandener@eliatra.com>
cwperks
previously approved these changes
Jun 9, 2025
willyborankin
previously approved these changes
Jun 9, 2025
Signed-off-by: Nils Bandener <33570290+nibix@users.noreply.github.com>
Collaborator
Author
|
@willyborankin @cwperks I needed to resolve a merge conflict. Can you approve again, please? :) |
willyborankin
approved these changes
Jun 11, 2025
cwperks
approved these changes
Jun 11, 2025
DarshitChanpura
approved these changes
Jun 11, 2025
5 tasks
aidenlindsay
pushed a commit
to aidenlindsay/security
that referenced
this pull request
Jun 23, 2025
…leges implementation and SubjectBasedActionPrivileges implementation (opensearch-project#5374) Signed-off-by: Nils Bandener <nils.bandener@eliatra.com> Signed-off-by: Nils Bandener <33570290+nibix@users.noreply.github.com> Co-authored-by: Darshit Chanpura <dchanp@amazon.com> Signed-off-by: Aiden Lindsay <aiden.o.lindsay@gmail.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is a refactoring of the
ActionPrivilegesclass: Its interface is decoupled from the implementation.ActionPrivilegesis not the interface,RoleBasedActionPrivilegescontains the actual implementation.Additionally, a new class
SubjectBasedActionPrivilegeswas introduced which provides an alternative mode of privilege evaluation;SubjectBasedActionPrivilegesdoes not consider mapped roles. A single instance ofSubjectBasedActionPrivilegesis meant for a single subject. This is useful for providing privileges for plugins (see #5341 ) and will be also useful for API tokens.RoleBasedActionPrivilegesseemed sensible. This principle can be also used for API tokens.Testing
SubjectBasedActionPrivilegesTestCheck List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.